From d3a2fb39a79a47b34b3c82f2be8dc4d4d56749bf Mon Sep 17 00:00:00 2001 From: Tan Zien Date: Sun, 6 Jul 2025 08:11:40 +0800 Subject: [PATCH] unzip: fix build GCC 15.1 refer to: https://gitlab.alpinelinux.org/alpine/aports/-/blob/b7410ac718d5eeae21001de5cae9159f597bb517/main/unzip/gcc15.patch fix this: unix/unxcfg.h:120:15: error: conflicting types for 'gmtime'; have 'struct tm *(void)' 120 | struct tm *gmtime(), *localtime(); | ^~~~~~ In file included from unix/unxcfg.h:119: /home/nasbdh9/openwrt/staging_dir/toolchain-x86_64_gcc-15.1.0_musl/include/time.h:59:12: note: previous declaration of 'gmtime' with type 'struct tm *(const time_t *)' {aka 'struct tm *(const long int *)'} 59 | struct tm *gmtime (const time_t *); | ^~~~~~ unix/unxcfg.h:120:26: error: conflicting types for 'localtime'; have 'struct tm *(void)' 120 | struct tm *gmtime(), *localtime(); | ^~~~~~~~~ /home/nasbdh9/openwrt/staging_dir/toolchain-x86_64_gcc-15.1.0_musl/include/time.h:60:12: note: previous declaration of 'localtime' with type 'struct tm *(const time_t *)' {aka 'struct tm *(const long int *)'} 60 | struct tm *localtime (const time_t *); | ^~~~~~~~~ Signed-off-by: Tan Zien --- utils/unzip/Makefile | 2 +- utils/unzip/patches/012-fix-gcc15-build.patch | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 utils/unzip/patches/012-fix-gcc15-build.patch diff --git a/utils/unzip/Makefile b/utils/unzip/Makefile index 255dfc7882..8cc30ddb17 100644 --- a/utils/unzip/Makefile +++ b/utils/unzip/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=unzip PKG_REV:=60 PKG_VERSION:=6.0 -PKG_RELEASE:=8 +PKG_RELEASE:=9 PKG_SOURCE:=$(PKG_NAME)$(PKG_REV).tar.gz PKG_SOURCE_URL:=@SF/infozip diff --git a/utils/unzip/patches/012-fix-gcc15-build.patch b/utils/unzip/patches/012-fix-gcc15-build.patch new file mode 100644 index 0000000000..0a764fbc90 --- /dev/null +++ b/utils/unzip/patches/012-fix-gcc15-build.patch @@ -0,0 +1,11 @@ +--- a/unix/unxcfg.h ++++ b/unix/unxcfg.h +@@ -117,7 +117,7 @@ typedef struct stat z_stat; + # endif + #else + # include +- struct tm *gmtime(), *localtime(); ++ struct tm *gmtime(const time_t *), *localtime(const time_t *); + #endif + + #if (defined(BSD4_4) || (defined(SYSV) && defined(MODERN))) -- 2.30.2